// 页面路径：store/index.js
import Vue from "vue";
import Vuex from "vuex";
import persistence from 'vuex-uniapp-persistence'
// 引入用户模块
import user from './user'
// 引入地址模块
import address from './address'
Vue.use(Vuex); //vue的插件机制
//Vuex.Store 构造器选项
const store = new Vuex.Store({
    state: {
        safeArea: uni.getSystemInfoSync().safeArea, // 获取系统信息
        bounding: uni.getMenuButtonBoundingClientRect(), // 获取胶囊信息
        platform: uni.getSystemInfoSync().platform  // 手机平台
    },
    mutations: {},
    getters: {},
    modules: { user, address },
    plugins: [persistence("rabbit")] // 使用持久化插件 rabbit本地存储中key的名称
});
export default store;